package cn.script.app;

import cn.script.app.bean.RoleInfo;
import cn.script.common.GlobalCnst;
import cn.script.fxj.FXBaseController;
import cn.script.fxj.bind.FxBind;
import javafx.fxml.FXML;
import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;

public class RoleAction extends FXBaseController {

    @FXML
    Label mHwnd;

    @FXML
    Label mName;

    @FxBind({
            "hwnd=mHwnd.text",
            "name=mName.text"
    })
    RoleInfo mRoleInfo;

    @FXML
    Label tHwnd;

    @FXML
    TextField tName;

    @FxBind({
            "hwnd=tHwnd.text",
            "name=tName.text",
            "off=enableTitle.selected"
    })
    RoleInfo tRoleInfo;

    @FXML
    CheckBox enableTitle;


    public RoleInfo getmRoleInfo() {
        return this.mRoleInfo;
    }

    public RoleInfo gettRoleInfo() {
        return this.tRoleInfo;
    }

    @FXML
    public void mBtnClick() {
        GlobalCnst.waitKey("home");
        long hwnd = GlobalCnst.DM_SOFT.getMousePointWindow();
        String name = GlobalCnst.getName(hwnd);
        this.mRoleInfo.setHwnd(hwnd + "");
        this.mRoleInfo.setName(name);
//        System.out.println(this.m_id.getText());
    }


    @FXML
    public void tBtnClick() {
        GlobalCnst.waitKey("end");
        long hwnd = GlobalCnst.DM_SOFT.getMousePointWindow();
        String name = GlobalCnst.getName(hwnd);
        this.tRoleInfo.setHwnd(hwnd + "");
        this.tRoleInfo.setName(name);
    }


}
